﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using TJADRICD.CollaborativeDesignPlugin.Commission;
using TJADRICD.DLL;

namespace TJADRICD.CollaborativeDesignPlugin.Form
{
    public partial class FormLoginCDPlugin : System.Windows.Forms.Form
    {
        private CommandLoginCD loginFunction = null;
        public FormLoginCDPlugin()
        {
            loginFunction = new CommandLoginCD();
            InitializeComponent();
            
        }

        private void ConfirmLogin_Click(object sender, EventArgs e)
        {
            UserLoginInf userInf = new UserLoginInf();
            userInf.userId = AccountLogin.Text;
            userInf.userPwd = PwdLogin.Text;

            if (loginFunction.LoginConfirm(userInf))
            {
                SignControl formSignControl = new SignControl();
                this.Hide();
                formSignControl.ShowDialog();
                this.Close();
            }
            else
                ExceptionInformation.Text = "用户名不存在或密码错误";
        }

        private void FormLoginCDPlugin_Load(object sender, EventArgs e)
        {
            ExceptionInformation.Text = "";
        }
    }
}
